﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HurSimLib
{
    /// <summary>
    /// The class that represents the processes making up the system.
    /// A process can be a server with a queue, a brancher which sends
    /// subsequent objects to different paths, or simply a path which
    /// is followed by objects in transition from one process to the next.
    /// </summary>
    public class HurProcess : HurProcessBase
    {

        /// <summary>
        /// This function accepts an object to the process queue (if any)
        /// after the object approves the entry. As a result, the object's process
        /// entry, process start and process end times are calculated.
        /// </summary>
        /// <param name="newobject"></param>
        public override void EnterObject(HurObject newobject)
        {
            // Calculate the service start time and inform the object
            newobject.EnterProcess(this, DateTime.Now);
            newobject.ExitProcess(this, DateTime.Now);
            Entryqueue.Add(newobject);
        }
    }
}
